package projectUtils;

public class ByteUtil {

	public static int ByteToInt(byte b)
	{
		return b & 0xff;
	}
	
	public static byte[] IntToByteArray(int value) 
	{
		byte[] b = new byte[4];
		for (int i = 0; i < 4; i++) {
			int offset = (b.length - 1 - i) * 8;
			b[i] = (byte) ((value >>> offset) & 0xFF);
		}
		return b;
	}
}
